<template>
  <el-tabs v-model="activeName">
    <slot name="header"></slot>
    <el-tab-pane label="项目信息" name="first">
      <info-view :related-data="relatedData"></info-view>
    </el-tab-pane>
    <el-tab-pane label="放款登记">
      <register-reply :query-id="queryId"></register-reply>
    </el-tab-pane>
    <el-tab-pane label="登记信息">
      <handler-project :view-mode="true" :query-id="queryId"></handler-project>
    </el-tab-pane>
    <el-tab-pane label="放款通知书" name="notice">
      <loan-notice :query-id="queryId"></loan-notice>
    </el-tab-pane>
    <el-tab-pane label="项目附件">
      <attach-view :query-id="queryId" :related-data="relatedData" :visible="visible"></attach-view>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import RegisterReply from '@/bigcredit/views/self/fast/register/components/RegisterReply'
import AttachView from '@/credit/components/AttachView'
import InfoView from '@/credit/views/city/bus/normal/Info'
import HandlerProject from '@/bigcredit/views/self/fast/item/components/HandlerProject'
import LoanNotice from '@/credit/views/county/unionProvince/components/LoanNotice'

export default {
  components: {
    InfoView,
    RegisterReply,
    HandlerProject,
    AttachView,
    LoanNotice,
  },
  props: {
    visible: Boolean,
    relatedData: Object,
    tabName: {
      type: String,
      default: 'first',
    },
  },
  computed: {
    queryId() {
      return this.relatedData.customer_related_id
    },
  },
  watch: {
    relatedData: {
      handler: function () {
        this.activeName = this.tabName
      },
      deep: true,
    },
    tabName(val) {
      this.activeName = val
    },
  },
  data() {
    return {
      activeName: this.tabName,
    }
  },
  methods: {},
}
</script>

<style></style>
